package com.drakulo.games.ais.core.delayed;

import com.drakulo.games.ais.core.audio.SoundHelper;
import com.drakulo.games.ais.core.tech.Technology;

/**
 * This action represents a research in progress
 * 
 * @author Drakulo
 * 
 */
public class ResearchAction extends DelayedAction {
	/**
	 * The technology researched
	 */
	private Technology tech;

	/**
	 * Constructor
	 * 
	 * @param tech
	 *            the technology researched
	 * @param duration
	 *            the research duration
	 */
	public ResearchAction(Technology tech, int duration) {
		super(duration, 0);
		this.tech = tech;
	}

	/**
	 * @return the technology researched
	 */
	public Technology getTechnology() {
		return this.tech;
	}
	
	public void step() {
		super.step();
		if(isDone()){
			SoundHelper.playSound(SoundHelper.RESEARCH_COMPLETE);
		}
	}
}
